'''
Author: duliang thinktanker@163.com
Date: 2024-05-16 23:44:48
LastEditors: duliang thinktanker@163.com
LastEditTime: 2025-08-07 15:07:11
FilePath: 
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
import requests
from txttopic import merge_images
import time

tag = ["ec4ccb4a8af049ceb1a6517506f14e6f", "4e6ec458bb1240e9bfaf67a539fb5783"]
if tag:
    # print(tag)
    imgdata_list = []
    try:
        # with open(r'.\image\com_error.png', 'rb') as img:
        #     return Response(img.read(), media_type="image/png")
        tag = eval(tag)
        for t in tag:
            imgdata = requests.get(
                f'http://www.jsswj.com.cn:88/jsswxxSSI/static/map1/0/3/{t}.png?t={int(time.time())}',
                timeout=0.5)
            imgdata_list.append(imgdata)
            images = merge_images(imgdata_list, f'./image/{t}_swpic.png')
    except Exception as e:
        print(e)
